﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AutoMapper;

using DevWeb.Biztalk.DeploymentSettings.WebUI.Models;

namespace DevWeb.Biztalk.DeploymentSettings.WebUI.Automapper
{
    public class IntegrationVersionSettingsViewProfile : Profile
    {
        public const string ViewModel = "IntegrationVersionSettingsViewProfile";

        public override string ProfileName
        {
            get { return ViewModel; }
        }

        protected override void Configure()
        {
            CreateMaps();
        }

        private static void CreateMaps()
        {
            Mapper.CreateMap<Data.CodeFirst.IntegrationVersionParameter, IntegrationVersionSettingsViewModel>();
                


            // .ForSourceMember(s => s.IntegrationVersion, t => t.Ignore())


            Mapper.CreateMap<IntegrationVersionSettingsViewModel, Data.CodeFirst.IntegrationVersionParameter>();
                //.ForMember(t => t.Version, opt => opt.Ignore())
                //.ForMember(t => t.IntegrationName, opt => opt.Ignore())
                //.ForMember(t => t.ProductId, opt => opt.Ignore())
                //.ForMember(t => t.IntegrationVersion, t => t.Ignore())
                //.ForSourceMember(s => s.ProductId, t => t.Ignore())
                //.ForSourceMember(s => s.IntegrationName, t => t.Ignore())
                //.ForSourceMember(s => s.Version, t => t.Ignore());


            //Mapper
            //    .CreateMap
            //    <IQueryable<IntegrationVersionSettingsViewModel>, IQueryable<Data.CodeFirst.IntegrationVersionParameter>>();
            //Mapper
            //    .CreateMap
            //    <IQueryable<Data.CodeFirst.IntegrationVersionParameter>, IQueryable<IntegrationVersionSettingsViewModel>>();
        }
    }
}